/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.dal;

import java.sql.ResultSet;

/**
 *
 * @author toan_pc
 */
public class Login {
    
    MyConnection con = new MyConnection();
    
        public boolean customerLogin(String adminName, String password) {
        try {
            String query = "{call sp_CheckLoginAdmin(?,?)}";
            Object[] params = {
                adminName,
                password
            };

            ResultSet rs = con.executeQuery(query, params);
            rs.next();
            int result = rs.getInt(1);
            con.closeConnection();
            return result > 0;
        } catch (Exception e) {
        } finally {
            con.closeConnection();
        }
        return false;
    }
}
